// 引入方法
import { request } from "../util/request";

export function pageMsgFunction(token,limit,offset,name,phone,major_id){
    return request({
        url:'/student/queryPage',
        method:'post',
        headers: {
            'Authorization': 'Bearer ' + token
        },
        data:{
            limit: limit,
            offset: offset,
            query: {
                name: name,
                phone: phone,
                major_id: major_id
            }
        }
    })
}
export function majorFunction(){
    return request({
        url:'/major/query',
        method:'get'
    })
}
export function createFunction(token,stu){
    return request({
        url:'/student/create',
        method:'post',
        headers: {
            'Authorization': 'Bearer ' + token
        },
        data:stu
    })
}
export function delFunction(token,id){
    return request({
        url:'/student/delete',
        method:'post',
        headers: {
            'Authorization': 'Bearer ' + token
        },
        data:{
            id:id
        }
    })
}
export function edditorFunction(token,data){
    return request({
        url:'/student/update',
        method:'post',
        headers: {
            'Authorization': 'Bearer ' + token
        },
        data:data
    })
}